package com.pikaqiu.warehouse.controller;

import com.pikaqiu.warehouse.domain.common.MiniAjaxResult;
import com.pikaqiu.warehouse.service.CommonService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;

/**
 * @Author: Administrator
 * @Date: 2024/8/15
 */
@RestController
@RequestMapping("/common")
public class CommonController {

    @Resource
    private CommonService commonService;

    @PostMapping("/upload/image")
    public MiniAjaxResult<String> uploadImage(String type, MultipartFile file) {
        return MiniAjaxResult.success(commonService.uploadImage(type, file));
    }
    @RequestMapping("/health")
    public String health() {
        return "ok";
    }
}
